package equipe2msvy.ProjectServeurApplication.beans;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="TRANSACTION")
@Inheritance(strategy=InheritanceType.JOINED)
public class Transaction implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="ID_TRANSACTION")
	private int idTransaction;
	public int getIdTransaction() {
		return idTransaction;
	}
	public void setIdTransaction(int idTransaction) {
		this.idTransaction = idTransaction;
	}
	public Collection<Offre> getOffre() {
		return offre;
	}
	public void setOffre(Collection<Offre> offre) {
		this.offre = offre;
	}
	@OneToMany(mappedBy = "transaction" , fetch = FetchType.LAZY)
	private Collection<Offre> offre;
	public Transaction() {
		super();
		// TODO Auto-generated constructor stub
	}
	
}
